# -*- coding: utf-8 -*-
"""
Created on Thu Sep 12 16:43:38 2019

@author: Administrator
"""

# 1013 数素数
# 题目本意：获取一定编号范围的素数
# 方法一：遍历编号，通过编号，获取对应编号素数
# 时间复杂度太高
# 方法二：直接获取编号范围素数
# 首先 根据编号范围，可知需要素数的个数
# 循环向所求素数list添加，直到满足最大编号
# 截取list编号范围
import math

def test():
    data = str(input()).split(' ')
    start = int(data[0])
    end = int(data[1])
    if (start <=0 or start > 10 ** 4) or \
            (end <= 0 or end > 10 ** 4):
        return
    
    prime_list = prime_range(start, end)
    loop = math.floor(len(prime_list) / 10)
    
    if loop == 0:
        print_result(prime_list)
        return
    
    for i in range(loop):
        print_result(prime_list[i*10:(i*10)+10])
    else:
        print_result(prime_list[(i+1)*10:end])
    
def print_result(line):
    
    str_line = [str(ele) for ele in line]
    print(' '.join(str_line))

def prime_range(start, end):
    result = []
    number = 2
    while len(result) != end:
        if prime(number) == True:
            result.append(number)
        number = number + 1
    return result[start-1:]

#print(prime_range(1,5))

def prime(data):
    if data == 1:
        return False
    if data == 2 or data == 3:
        return True
    if data % 6 != 1 and data % 6 != 5:
        return False
    sqrt_data = math.ceil(math.sqrt(data))
    for i in range(5, sqrt_data+1, 6):
        if data % i == 0 or data % (i+2) == 0:
            return False
    return True
#print(prime(25))

test()
